package com.bstek.urule.springboot.action;

import com.bstek.urule.model.ExposeAction;
import com.test.alarm.domain.entity.AlarmEntity;
import com.test.demo.domain.entity.Customer;
import org.apache.commons.lang.math.IntRange;
import org.apache.commons.lang.math.RandomUtils;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.stereotype.Component;

import java.util.*;

@Component
public class DemoAction {

    @ExposeAction(value = "selectCustoms")
    public List<Customer> selectCustoms(String phoneNo) {
        List<Customer> result = new ArrayList<>();
        Customer customer = null;
        for (String name : Arrays.asList("zhangsan","lisi","wangwu")) {
            customer = new Customer();
            customer.setName(name);
            customer.setAge(RandomUtils.nextInt());
            customer.setBirthday(new Date());
            customer.setCar(RandomUtils.nextBoolean());
            customer.setHouse(RandomUtils.nextBoolean());
            customer.setGender(RandomUtils.nextBoolean());
            customer.setMarried(RandomUtils.nextBoolean());
            customer.setMobile(phoneNo);
            result.add(customer);
        }
        return result;
    }
}
